<template>
  <div>
    <el-form :model="form" :rules="rules" ref="form" label-width="80px" class="login-box">
      <h3>登录</h3>
           <el-form-item label="账号" prop="userId">
              <el-input v-model="form.user" placeholder="请输入用户名或邮箱地址"></el-input>
            </el-form-item>
            <el-form-item label="密码" prop="password">
              <el-input v-model="form.password" placeholder="请输入密码"></el-input>
            </el-form-item>

      <el-form-item>
       <el-button type="primary" @click="onSubmit('form')">管理员登录</el-button>

      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "admin",
  data(){
    return{
      form: {
        user: '',
        password: '',
        uid: '',
        name: '',
        company: '',
        phone: '',
        type: '',
        remark: '',
      },
      rules: {
        userId: [
          {required: true, message: '请输入账号', trigger: 'blur'}
        ],
        password: [
          {required: true, message: '请输入密码', trigger: 'blur'}
        ]
      },
    }
  },
  methods: {
    // 实现管理员登陆
    onSubmit(){

      this.$router.push({path:'/admin/contentReview'})

      // 管理员登录的逻辑
      // const adminLoginURL = this.$axiosnew.defaults.baseURL + "/admin/login"
      // this.$axios.post(adminLoginURL, this.form).then((res)=>{
      //   console.log(res)
      //   this.$router.push({path:'/admin/systemFunction'})
      // }).catch((error)=>{
      //   console.log(error.data)
      // })



    }
  }

}
</script>

<style scoped>
.login-box {

  width: 400px;

  margin: 200px auto;

  border: aqua;

  padding: 40px;

  border-radius: 10px;

  box-shadow: 0 0 30px #2c3e50;
}
</style>